Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PYBIND11_INTERNALS_VERSION 6 the default on all platforms. #5512

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Feb 3, 2025

Description

Make PYBIND11_INTERNALS_VERSION 6 the default on all platforms.

Follow-on to PYBIND11_PLATFORM_ABI_ID modernizations under PRs #4953 and #5439.

Rationale for this PR:

  • The PYBIND11_PLATFORM_ABI_ID modernizations under PRs 4953 and 5439 already created an ABI break (see below) in most situations. The only exception is when all of thePYBIND11_COMPILER_TYPE PYBIND11_STDLIB, and PYBIND11_BUILD_ABI macros (see here) are overriden explicitly. — This is assumed to be rare.

  • Standardizing on PYBIND11_INTERNALS_VERSION 6 for all platforms is therefore assumed to cause few additional ABI breaks, but makes it much easier to reason about the pybind11 behavior, and it sets the stage for eventually purging old code:

  • This PR intentionally does not remove the code for supporting PYBIND11_INTERNALS_VERSIONs 4 and 5. Therefore users can still override the default if necessary.

  • After some transition period the code for supporting PYBIND11_INTERNALS_VERSIONs 4 and 5 should be purged, especially because it is no longer exercised in the pybind11 GitHub Actions.

  • Regarding the choice of version number for the next release: The ABI break is the only kind of break, and the additional features compared to the 2.13 release series are mostly incremental. Therefore @rwgk believes v2.14.0 is better as a version number than v3.0.0.


ABI break: Extensions built with e.g. pybind11 2.13 will not interoperate with extensions built with pybind11 2.14.

Note for completeness: PR #5296 greatly reduced the impact of changing the PYBIND11_INTERNALS_VERSION (see PR description there). The ABI break due to PRs #4953 and #5439 is quite likely the last major pybind11 ABI break.

Suggested changelog entry:

``PYBIND11_INTERNALS_VERSION 6`` is now the default on all platforms.

Copy link
Collaborator

@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be fine to make this pybind11 3, combined with the Python and CMake version bumps, and compiler bumps we've already added. That could also mean we could remove ABI <6, as a major version bump was supposed to be an ABI bump I believe. But regardless, I think this makes sense.

@rwgk
Copy link
Collaborator Author

rwgk commented Feb 12, 2025

I think it would be fine to make this pybind11 3, combined with the Python and CMake version bumps, and compiler bumps we've already added. That could also mean we could remove ABI <6, as a major version bump was supposed to be an ABI bump I believe. But regardless, I think this makes sense.

OK, thanks! Let's discuss separately.

@rwgk rwgk merged commit c316cf3 into pybind:master Feb 12, 2025
76 checks passed
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Feb 12, 2025
@rwgk rwgk deleted the Default_INTERNALS_VERSION_6 branch February 12, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changelog Possibly needs a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants